import cv2
import numpy as np

# 创建字典
dictionary = cv2.aruco.getPredefinedDictionary(cv2.aruco.DICT_6X6_250)

# 创建board (6×8棋盘，每个方格4cm，标记3.2cm)
board = cv2.aruco.CharucoBoard((6, 8), 0.04, 0.032, dictionary)

# 生成ChArUco板
imboard = board.generateImage((600, 800))

# 保存图像
cv2.imwrite("charuco_board.png", imboard)